package cn.hxzy.service.impl;

import cn.hxzy.domain.TaskManager;
import cn.hxzy.mapper.TaskManagerMapper;
import cn.hxzy.service.TaskManagerService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;

@Service
public class TaskManagerServiceImpl extends ServiceImpl<TaskManagerMapper, TaskManager> implements TaskManagerService {
    @Autowired
    private TaskManagerMapper taskManagerMapper;
    @Override
    public boolean updateTaskManger(TaskManager taskManager) {
        LambdaQueryWrapper<TaskManager> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TaskManager::getTaskId, taskManager.getTaskId());
        queryWrapper.eq(TaskManager::getStudentId, taskManager.getStudentId());
        int update = taskManagerMapper.update(taskManager, queryWrapper);
        if (update > 0){
            return true;
        }
        return false;
    }
}
